package com.kgcx.coupon.service;

import com.kgcx.coupon.domain.AppointMutex;
import com.kgcx.coupon.mapper.AppointMutexMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 何凯
 * @version 0.1
 * @description
 * @time 2017/12/12 17:35
 * @since 0.1
 */
@Service
public class AppointMutexService {
    @Autowired
    private AppointMutexMapper appointMutexMapper;

    /**
     * 单条新增互斥方案
     * @param mutex
     */
    public void saveAppointMutex(AppointMutex mutex){
        appointMutexMapper.insert(mutex);
    }
    /**
     * 批量新增指定互斥方案
     * @param list
     */
    public void insertByBatch(List<AppointMutex> list){
        appointMutexMapper.insertByBatch(list);
    }

    /**
     * 删除指定互斥方案
     * @param kid
     */
    public void deleteByPrimaryKey(Integer kid){
        appointMutexMapper.deleteByPrimaryKey(kid);
    }
    /**
     * 删除指定互斥方案
     * @param planId
     */
    public void deleteByPlanId(Integer planId){
        appointMutexMapper.deleteByPlanId(planId);
    }

    /**
     * 修改指定互斥方案
      * @param record
     */
    public void updateByPrimaryKey(AppointMutex record){
        appointMutexMapper.updateByPrimaryKeySelective(record);
    }

    /**
     * 根据planId查询互斥方案
     * @param planId
     * @return
     */
    public List<AppointMutex> selectByPlanId(Integer planId){
       return appointMutexMapper.selectByPlanId(planId);
    }

}
